package com.inspur_video.inspur_video.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 小浩
 * @date 2018-08-12 20:40
 * @package com.inspur_video.inspur_video.controller
 * @description
 */
@Controller
@RequestMapping("user")
public class UserBackController {

    @Autowired
    HttpSession httpSession;
    /**
     * 退出登录
     */
    @RequestMapping(value = "/logout")
    public String logout(){
        System.out.println(httpSession.getAttribute("user"));
        httpSession.removeAttribute("user");
        return "redirect:/login";
    }

}
